home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DATABASE / OBJ1_2.ZIP;1 / OCLIP.PRG < prev    next >
Encoding:
Text File  |  1992-06-30  |  5.0 KB  |  131 lines

  1. /*
  2. …ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕª
  3. ∫                                o:Clip                                ∫
  4. ∫             An Object Oriented Extension to Clipper 5.01             ∫
  5. ∫                 (c) 1991 Peter M. Freese, CyberSoft                  ∫
  6. »ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕº
  7.  
  8. Version 1.01x - 06/25/92
  9. Modified by JHK,JHK-Software,Piestany
  10. */
  11.  
  12. EXTERNAL ;
  13.   __IVAR001,__IVAR002,__IVAR003,__IVAR004,__IVAR005,;
  14.   __IVAR006,__IVAR007,__IVAR008,__IVAR009,__IVAR010,;
  15.   __IVAR011,__IVAR012,__IVAR013,__IVAR014,__IVAR015,;
  16.   __IVAR016,__IVAR017,__IVAR018,__IVAR019,__IVAR020,;
  17.   __IVAR021,__IVAR022,__IVAR023,__IVAR024,__IVAR025,;
  18.   __IVAR026,__IVAR027,__IVAR028,__IVAR029,__IVAR030,;
  19.   __IVAR031,__IVAR032,__IVAR033,__IVAR034,__IVAR035,;
  20.   __IVAR036,__IVAR037,__IVAR038,__IVAR039,__IVAR040,;
  21.   __IVAR041,__IVAR042,__IVAR043,__IVAR044,__IVAR045,;
  22.   __IVAR046,__IVAR047,__IVAR048,__IVAR049,__IVAR050,;
  23.   __IVAR051,__IVAR052,__IVAR053,__IVAR054,__IVAR055,;
  24.   __IVAR056,__IVAR057,__IVAR058,__IVAR059,__IVAR060,;
  25.   __IVAR061,__IVAR062,__IVAR063,__IVAR064,__IVAR065,;
  26.   __IVAR066,__IVAR067,__IVAR068,__IVAR069,__IVAR070,;
  27.   __IVAR071,__IVAR072,__IVAR073,__IVAR074,__IVAR075,;
  28.   __IVAR076,__IVAR077,__IVAR078,__IVAR079,__IVAR080,;
  29.   __IVAR081,__IVAR082,__IVAR083,__IVAR084,__IVAR085,;
  30.   __IVAR086,__IVAR087,__IVAR088,__IVAR089,__IVAR090,;
  31.   __IVAR091,__IVAR092,__IVAR093,__IVAR094,__IVAR095,;
  32.   __IVAR096,__IVAR097,__IVAR098,__IVAR099,__IVAR100,;
  33.   __IVAR101,__IVAR102,__IVAR103,__IVAR104,__IVAR105,;
  34.   __IVAR106,__IVAR107,__IVAR108,__IVAR109,__IVAR110,;
  35.   __IVAR111,__IVAR112,__IVAR113,__IVAR114,__IVAR115,;
  36.   __IVAR116,__IVAR117,__IVAR118,__IVAR119,__IVAR120
  37.  
  38. EXTERNAL ;
  39.   __SIVAR001,__SIVAR002,__SIVAR003,__SIVAR004,__SIVAR005,;
  40.   __SIVAR006,__SIVAR007,__SIVAR008,__SIVAR009,__SIVAR010,;
  41.   __SIVAR011,__SIVAR012,__SIVAR013,__SIVAR014,__SIVAR015,;
  42.   __SIVAR016,__SIVAR017,__SIVAR018,__SIVAR019,__SIVAR020,;
  43.   __SIVAR021,__SIVAR022,__SIVAR023,__SIVAR024,__SIVAR025,;
  44.   __SIVAR026,__SIVAR027,__SIVAR028,__SIVAR029,__SIVAR030,;
  45.   __SIVAR031,__SIVAR032,__SIVAR033,__SIVAR034,__SIVAR035,;
  46.   __SIVAR036,__SIVAR037,__SIVAR038,__SIVAR039,__SIVAR040,;
  47.   __SIVAR041,__SIVAR042,__SIVAR043,__SIVAR044,__SIVAR045,;
  48.   __SIVAR046,__SIVAR047,__SIVAR048,__SIVAR049,__SIVAR050,;
  49.   __SIVAR051,__SIVAR052,__SIVAR053,__SIVAR054,__SIVAR055,;
  50.   __SIVAR056,__SIVAR057,__SIVAR058,__SIVAR059,__SIVAR060,;
  51.   __SIVAR061,__SIVAR062,__SIVAR063,__SIVAR064,__SIVAR065,;
  52.   __SIVAR066,__SIVAR067,__SIVAR068,__SIVAR069,__SIVAR070,;
  53.   __SIVAR071,__SIVAR072,__SIVAR073,__SIVAR074,__SIVAR075,;
  54.   __SIVAR076,__SIVAR077,__SIVAR078,__SIVAR079,__SIVAR080,;
  55.   __SIVAR081,__SIVAR082,__SIVAR083,__SIVAR084,__SIVAR085,;
  56.   __SIVAR086,__SIVAR087,__SIVAR088,__SIVAR089,__SIVAR090,;
  57.   __SIVAR091,__SIVAR092,__SIVAR093,__SIVAR094,__SIVAR095,;
  58.   __SIVAR096,__SIVAR097,__SIVAR098,__SIVAR099,__SIVAR100,;
  59.   __SIVAR101,__SIVAR102,__SIVAR103,__SIVAR104,__SIVAR105,;
  60.   __SIVAR106,__SIVAR107,__SIVAR108,__SIVAR109,__SIVAR110,;
  61.   __SIVAR111,__SIVAR112,__SIVAR113,__SIVAR114,__SIVAR115,;
  62.   __SIVAR116,__SIVAR117,__SIVAR118,__SIVAR119,__SIVAR120
  63.  
  64. STATIC aClassList := {}, aMethodList := {}, aVarList := {}, nCurrent := 0
  65. STATIC oChild
  66.  
  67. FUNCTION __DefineClass(cName,bParent)
  68.   LOCAL nParent,oParent
  69.   if(bParent <> nil,oParent:= Eval(bParent),) // ensure parent defined
  70.   AADD(aClassList,UPPER(cName))
  71.   AADD(aMethodList,{ {"__PARENT","__PARENT"} })
  72.   AADD(aVarList,{})
  73.   ++nCurrent
  74.   if bParent <> nil .and. ;
  75.     (nParent := ASCAN(aClassList,UPPER(oParent:ClassName))) <> 0
  76.     aMethodList[nCurrent] := ACLONE(aMethodList[nParent])
  77.     aVarList[nCurrent] := ACLONE(aVarList[nParent])
  78.   end
  79.   RETURN oParent
  80.  
  81. PROCEDURE __AddVar(cName)
  82.   AADD(aVarList[nCurrent],cName)
  83.   RETURN
  84.  
  85. PROCEDURE __AddMethod(cName,cUDF)
  86.   LOCAL n
  87.   cName := UPPER(cName)
  88.   n := ASCAN(aMethodList[nCurrent], { |aMethod| aMethod[1] == cName } )
  89.   if n > 0
  90.     aMethodList[nCurrent,n] := {cName,cUDF} //override parent method
  91.   else
  92.     AADD(aMethodList[nCurrent],{cName,cUDF})
  93.   end
  94.   RETURN
  95.  
  96. FUNCTION __MakeClass()
  97.   LOCAL i := 0,cVar,s
  98.   LOCAL nHandle := __ClassNew(aClassList[nCurrent],LEN(aVarList[nCurrent])+1)
  99.   AEVAL(aMethodList[nCurrent],;
  100.     {|cMethod| __ClassAdd(nHandle,cMethod[1],cMethod[2]) } )
  101.   while i++ < LEN(aVarList[nCurrent])
  102.     cVar := aVarList[nCurrent,i]
  103.     s := PADL(LTRIM(STR(i+1)),3,"0")    //JHK
  104.     __ClassAdd(nHandle,cVar,"__IVAR"+s)
  105.     __ClassAdd(nHandle,"_"+cVar,"__SIVAR"+s)
  106.   end
  107.   RETURN nHandle
  108.  
  109. FUNCTION __PARENT(cClass)   //virtual method
  110.   LOCAL oParent
  111.   oChild:=QSelf()
  112.   oParent:=oChild[1]
  113.   if !(cClass==nil)
  114.     cClass:=Upper(cClass)
  115.     while !(cClass==oParent:ClassName); oParent:=oParent[1]; end
  116.   end
  117.   RETURN oParent
  118.  
  119. FUNCTION __GetSelf(self)
  120.   LOCAL r:=if(oChild==nil,self,oChild)
  121.   oChild:=nil
  122.   RETURN r
  123.  
  124. FUNCTION __ParentNew(self)
  125.   if(oChild==nil,oChild:=self,)
  126.   RETURN oChild
  127.  
  128. FUNCTION __PutSelf(self)
  129.   RETURN oChild:=self
  130.  
  131.